package services.impl;

import beans.Product;
import dao.ProductDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import services.ProductServices;

import java.util.List;

@Service
public class ProductServicesImpl implements ProductServices {
    @Autowired
    private ProductDao productDao;

    @Override
    public List<Product> selectList() {
        List<Product> list = productDao.selectList();
        return list;
    }

    @Override
    public List<Product> selectSelective(String select,String inputText) {
        List<Product> list = productDao.selectSelective(select,inputText);
        return list;
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        int i = productDao.deleteByPrimaryKey(id);
        return i;
    }

    @Override
    public int insert(Product record) {
        int i = productDao.insert(record);
        return i;
    }

    @Override
    public int insertSelective(Product record) {
        int i = productDao.insertSelective(record);
        return i;
    }

    @Override
    public Product selectByPrimaryKey(Integer id) {
        Product product = productDao.selectByPrimaryKey(id);
        return product;
    }

    @Override
    public int updateByPrimaryKeySelective(Product record) {
        int i = productDao.updateByPrimaryKeySelective(record);
        return i;
    }

    @Override
    public int updateByPrimaryKey(Product record) {
        int i = productDao.updateByPrimaryKey(record);
        return i;
    }

    @Override
    public int count() {
        return productDao.count();
    }
}
